package com.biblio.repository;

import org.springframework.stereotype.Repository;

import com.biblio.dom.Editor;

@Repository
public class EditorRepository extends BaseRepository<Editor> {
	
	public  Editor getEditorByWeb(String identifier)  {
        return getSingleOrNullResult( em.createQuery("select e from Editor e where lower(e.editorWeb) =:url")
                .setParameter("url", identifier.toLowerCase())
                );
        }

    public  Editor getEditorByName(String identifier) {
        return getSingleOrNullResult( 
                em.createQuery("select e from Editor e where lower(e.editorName) =:name")
                .setParameter("name", identifier.toLowerCase())
                );

    }  

}
